package reports.builders;

import java.util.Iterator;

/**
 * @author Ian Ryu
 * 
 *         Interface for different types of report builder.
 * 
 */
public interface IBuilder<T>
{

  /**
   * Adds a title to the document
   * 
   * @param title
   *          : String document title
   */
  public IBuilder<T> addTitle(String title);

  /**
   * Adds a subtitle to the document
   * 
   * @param subTitle
   *          : String subtitle for document
   */
  public IBuilder<T> addSubTitle(String subTitle);

  /**
   * initialize table and start it
   * 
   * @param columns
   *          : number of table columns
   */
  public IBuilder<T> startTable(int columns);

  /**
   * add table headers(list of strings) to the table so should be called after startTable()
   * 
   * @param headers
   *          : String list of headers for the table
   */
  public IBuilder<T> addTableHeader(Iterator<String> headers);

  /**
   * add row to the table, so should be called after startTable()
   * 
   * @param row
   *          : number of rows to be added to the table
   */
  public IBuilder<T> addRow(Iterator<String> row);

  /**
   * finish the table and add it to document after being added, table can't be modified
   * 
   */
  public IBuilder<T> endTable();

  /**
   * insert padding between paragraph/table etc...
   * 
   * @param value
   *          : integer value of padding
   */
  public IBuilder<T> insertPadding(int value);

  /**
   * add plain text to the document
   * 
   * @param text
   *          : string to be added to document
   */
  public IBuilder<T> addParagraph(String text);

  /**
   * add list to the document
   * 
   * @param list
   *          : String list of information
   */
  public IBuilder<T> addList(Iterator<String> list);

  public abstract T getData();
}
